package com.tiancheng.onecode.feign;

import com.tiancheng.onecode.configuration.FeignClientConfig;
import com.tiancheng.onecode.feign.fallback.TCFeignClientFallbackFactory;
import com.tiancheng.onecode.model.dto.ChangeOrgManagerDTO;
import com.tiancheng.onecode.model.dto.SyncSaveMerchantInfoRequest;
import com.tiancheng.onecode.model.dto.SysMessageRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * @author jiangjun
 * @description 天成服务
 * @date 2024/12/9 15:22
 */
@FeignClient(name = "TCFeignClient",
        url="${tc-service-config.domain}",
        configuration = FeignClientConfig.class,
        fallbackFactory = TCFeignClientFallbackFactory.class)
public interface TCFeignClient {

    @PostMapping("/api/SaveEnterpriseInfo_OneCode")
    String saveEnterpriseInfoHotel(@RequestBody SyncSaveMerchantInfoRequest request,
                                   @RequestHeader("X-Token") String xToken);

    @GetMapping("/api/CheckLogin1")
    String CheckLogin1(Map<String, String> body,
                       @RequestHeader("X-Token") String xToken);
    /**
     * 向用户推送消息
     * @param request
     * @param xToken
     * @return
     */
    @PostMapping("/api/SysMessages/SendSysMsg")
    String SendSysMsg(@RequestBody SysMessageRequest request,
                                   @RequestHeader("X-Token") String xToken);
    /**
     * 查询商户管理员列表
     * @param request
     * @param xToken
     * @return
     */
    @PostMapping("/api/Users/GetOrgUsers")
    String getOrgUsers(@RequestBody Map<String, String> request,
                      @RequestHeader("X-Token") String xToken);
    /**
     * 查询商户管理员列表
     * @param request
     * @param xToken
     * @return
     */
    @PostMapping("/api/Users/ChangeOrgManager")
    String ChangeOrgManager(@RequestBody ChangeOrgManagerDTO request,
                       @RequestHeader("X-Token") String xToken);

}
